<template>
  <div class="hello">
    <div>
      <img src="@/assets/logo.png" alt="头像加载中..." />欢迎管理员
    </div>
    <el-button type="info" @click="toBack">退出</el-button>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import { useRouter } from 'vue-router'
export default defineComponent({
  name: 'HelloWorld',
  setup () {
    const { push } = useRouter()
    const toBack = () => {
      window.sessionStorage.clear()
      push({
        path: '/login'
      })
    }
    return {
      toBack
    }
  }
})
</script>

<style scoped lang="scss">
.hello {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #ccc;
  }
}
</style>
